package com.mind.customer.domain.vo;


import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.util.List;

@Data
public class AIRuleRep {

    @JsonProperty("code")
    private int code;

    @JsonProperty("msg")
    private String msg;

    @JsonProperty("data")
    private Data data;

    @lombok.Data
    public static class Data {
        @JsonProperty("json_data")
        private JsonData jsonData;

        @JsonProperty("meta")
        private Meta meta;

        @JsonProperty("consumption")
        private Consumption consumption;

        @JsonProperty("log")
        private Log log;

        @JsonProperty("logId")
        private int logId;


    }

    @lombok.Data
    public static class JsonData {
        @JsonProperty("分析过程")
        private String analysisProcess;

        @JsonProperty("是否通过")
        private boolean passed;

        @JsonProperty("理由")
        private String reason;

    }

    @lombok.Data
    public static class Meta {
        @JsonProperty("time")
        private TimeMetrics time;

        @JsonProperty("reasoning_content")
        private Object reasoningContent; // Can be replaced with specific type if needed

        @lombok.Data
        public static class TimeMetrics {
            @JsonProperty("extract")
            private TimeStats extract;

            @lombok.Data
            public static class TimeStats {
                @JsonProperty("length")
                private int length;

                @JsonProperty("sum")
                private String sum;

                @JsonProperty("mean")
                private String mean;

                @JsonProperty("median")
                private String median;

                @JsonProperty("min")
                private String min;

                @JsonProperty("max")
                private String max;


            }
        }
    }

    @lombok.Data
    public static class Consumption {
        @JsonProperty("prices")
        private List<Integer> prices;

        @JsonProperty("usages")
        private List<Usage> usages;

        @lombok.Data
        public static class Usage {
            @JsonProperty("type")
            private String type;

            @JsonProperty("name")
            private String name;

            @JsonProperty("supplier")
            private String supplier;

            @JsonProperty("count")
            private int count;

        }
    }

    @lombok.Data
    public static class Log {
        @JsonProperty("id")
        private long id;

        @JsonProperty("updated_at")
        private String updatedAt;

        @JsonProperty("created_at")
        private String createdAt;

        @JsonProperty("deleted_at")
        private String deletedAt; // Can be OffsetDateTime if needed

        @JsonProperty("duration")
        private long duration;

        @JsonProperty("token")
        private long token;


    }
}
